﻿using LimaLims.Application.Service.Base.Dto;
using LimaLims.Core;
using LimaLims.Core.Enum;
using LimaLims.Core.Util;
using Microsoft.EntityFrameworkCore;

namespace LimaLims.Application.Service.Basic.Dto
{
    public class AddSerialNumberRulesInput:BaseDto
    {
        /// <summary>
        /// 业务类型
        /// </summary>
        public BusinessType BusinessType { get; set; }

        /// <summary>
        /// 业务前缀
        /// </summary>
        public string Prefix { get; set; }

        /// <summary>
        /// 日期格式
        /// </summary>
        public RulesDateType RulesDateType { get; set; }

        /// <summary>
        /// 流水号位数
        /// </summary>
        public int Digit { get; set; }

        /// <summary>
        /// 编号生成规则
        /// </summary>
        [Comment("编号生成规则")]
        public string RulesText { get; set; }
    }

    public class EditSerialNumberRulesInput: AddSerialNumberRulesInput
    {

    }

    public class SerialNumberRulesOutput : BaseDto
    {
        /// <summary>
        /// 业务类型
        /// </summary>
        public BusinessType BusinessType { get; set; }

        /// <summary>
        /// 业务类型文本
        /// </summary>
        public string BusinessTypeText => BusinessType.GetDescription();

        /// <summary>
        /// 业务前缀
        /// </summary>
        public string Prefix { get; set; }

        /// <summary>
        /// 日期格式
        /// </summary>
        public RulesDateType RulesDateType { get; set; }

        /// <summary>
        /// 日期格式文本
        /// </summary>
        public string RulesDateTypeText => RulesDateType.GetDescription();

        /// <summary>
        /// 流水号位数
        /// </summary>
        public int Digit { get; set; }

        /// <summary>
        /// 编号生成规则
        /// </summary>
        [Comment("编号生成规则")]
        public string RulesText { get; set; }
    }

    /// <summary>
    /// 编号规则分页
    /// </summary>
    public class SerialNumberRulesPageInput : PageInputBase
    {
        public BusinessType? Type { get; set; }
    }
}
